<?php
namespace app\tag\controller;
use app\common\controller\UserBase;

class ApiUserTag extends UserBase
{
    protected $beforeActionList = ['start'];
    public function start() {
        $this->item = 'Tags';
        $this->itemType = 'tag';
        $this->itemName = '标签';
        $this->itemCategory = 'TagsCategory';
        $this->itemContent = 'TagsContent';
        $this->itemModelNameSpace = 'app\tag\model\Tags';
        $this->itemCategoryModelNameSpace = 'app\tag\model\TagsCategory';
    }
    
    public function itemList()
    {
        $data = $this->request->post();
        $itemList = model($this->itemModelNameSpace)->getItemList($data);
        $itemCount = model($this->itemModelNameSpace)->getCount($data['cid'], $data['keywords']);
	    return jsonSuccess('',['itemList' => $itemList,'total' => $itemCount,'page' => $data['page']]);
    }
}